# -*- coding: utf-8 -*-
import requests,requests.exceptions
try:
    #会抛出超时异常
    r=requests.get('https://www.jd.com',timeout=0.01)
    print(r.text)
except requests.exceptions.Timeout as e:
    print(e)
    
#抛出链接超时异常
requests.get('https://www.jd.com',timeout=(0.001,0.01))

#永久等待，不会 抛出异常
requests.get('https://www.jd.com',timeout=None)

